﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace BookOnline.Data
{
    public class Cat
    {
        private string _CatID;
        private string _CatName;
        private string _CatParent;

        public string CatID
        {
            get { return _CatID; }
            set { _CatID = value; }
        }
        public string CatName
        {
            get { return _CatName; }
            set { _CatName = value; }
        }
        public string CatParent
        {
            get { return _CatParent; }
            set { _CatParent = value; }
        }

        public Cat CatIDataReader(IDataReader dr)
        {
            Data.Cat obj = new Cat();
            obj.CatID = (dr["CatID"] is DBNull) ? string.Empty : dr["CatID"].ToString();
            obj.CatName = (dr["CatName"] is DBNull) ? string.Empty : dr["CatName"].ToString();
            obj.CatParent = (dr["CatParent"] is DBNull) ? string.Empty : dr["CatParent"].ToString();
            return obj;
        }
    }
}
